﻿package mortal.game.view.guild.cellrender
{
    import Message.Game.*;
    import com.mui.controls.*;
    import com.mui.display.*;
    import mortal.common.global.*;
    import mortal.component.gconst.*;
    import mortal.game.resource.*;
    import mortal.game.utils.*;
    import mortal.game.view.common.*;

    public class GuildWarnMemberListCellRenderer extends GuildCellRenderer
    {
        private var _txtMemberName:GTextFiled;
        private var _txtPosition:GTextFiled;
        private var _txtWeekContribution:GTextFiled;
        private var _txtActives:GTextFiled;
        private var _txtReason:GTextFiled;

        public function GuildWarnMemberListCellRenderer()
        {
            return;
        }// end function

        override protected function initSkin() : void
        {
            var _loc_1:* = new GBitmap();
            var _loc_2:* = UIFactory.bg(0, 0, 300, 48, null, ImagesConst.selectFilter);
            this.setStyle("downSkin", _loc_2);
            this.setStyle("overSkin", _loc_2);
            this.setStyle("upSkin", _loc_1);
            this.setStyle("selectedDownSkin", _loc_2);
            this.setStyle("selectedOverSkin", _loc_2);
            this.setStyle("selectedUpSkin", _loc_2);
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._txtMemberName = UIFactory.gTextField("", 30, 3, 100, 20, this);
            this._txtPosition = UIFactory.gTextField("xxxx", 120, 3, 60, 20, this, GlobalStyle.textFormatPutong.center());
            this._txtWeekContribution = UIFactory.gTextField("100000", 190, 3, 55, 20, this, GlobalStyle.textFormatPutong.right());
            this._txtActives = UIFactory.gTextField("100000", 270, 3, 50, 20, this, GlobalStyle.textFormatPutong.right());
            this._txtReason = UIFactory.gTextField("100000", 320, 3, 120, 20, this, GlobalStyle.textFormatPutong.center());
            return;
        }// end function

        override public function get data() : Object
        {
            return super.data;
        }// end function

        override public function set data(param1:Object) : void
        {
            super.data = param1;
            var _loc_2:* = param1 as SWarningMember;
            if (_loc_2 == null)
            {
                return;
            }
            if (_loc_2.miniPlayer.online)
            {
                var _loc_3:* = GuildUtil.MemberOnlineColor;
                this._txtActives.textColor = GuildUtil.MemberOnlineColor;
                var _loc_3:* = _loc_3;
                this._txtReason.textColor = _loc_3;
                var _loc_3:* = _loc_3;
                this._txtWeekContribution.textColor = _loc_3;
                var _loc_3:* = _loc_3;
                this._txtPosition.textColor = _loc_3;
                this._txtMemberName.textColor = _loc_3;
            }
            else
            {
                var _loc_3:* = GuildUtil.MemberOfflineColor;
                this._txtActives.textColor = GuildUtil.MemberOfflineColor;
                var _loc_3:* = _loc_3;
                this._txtReason.textColor = _loc_3;
                var _loc_3:* = _loc_3;
                this._txtWeekContribution.textColor = _loc_3;
                var _loc_3:* = _loc_3;
                this._txtPosition.textColor = _loc_3;
                this._txtMemberName.textColor = _loc_3;
            }
            this._txtMemberName.text = _loc_2.miniPlayer.name;
            this._txtPosition.text = GameDefConfig.instance.getItem("EGuildPostion", _loc_2.position).text;
            if (_loc_2.miniPlayer.online)
            {
                this._txtPosition.textColor = parseInt(GameDefConfig.instance.getItem("EGuildPostion", _loc_2.position).text1.split("#")[1], 16);
            }
            this._txtWeekContribution.text = _loc_2.contributionWeek.toString();
            this._txtActives.text = _loc_2.activity.toString();
            this._txtReason.text = GuildConst.getWarnReasonStr(_loc_2.reason);
            return;
        }// end function

        override protected function quickDispose() : void
        {
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._txtMemberName.dispose(param1);
            this._txtPosition.dispose(param1);
            this._txtWeekContribution.dispose(param1);
            this._txtActives.dispose(param1);
            this._txtReason.dispose(param1);
            this._txtMemberName = null;
            this._txtPosition = null;
            this._txtWeekContribution = null;
            this._txtActives = null;
            this._txtReason = null;
            return;
        }// end function

    }
}
